var crypto=require('crypto');
var fs=require('fs');
var path=require('path');
module.exports.dest_doc_path=exports.dest_doc_path=function(doc_root,filename){
	var hash = crypto.createHash('md5');
	hash.update(filename);
	var str=hash.digest('hex');
	var file_path=doc_root;
	for(i=0;i<32;i=i+2){
		file_path=path.resolve(file_path,str.substr(i,2));
		if(!fs.existsSync(file_path)){
			fs.mkdirSync(file_path);
		}
	}
	return path.resolve(file_path).replace(doc_root,'');
}